package dataImport.action.abstracts;

import java.io.Serializable;
import dataImport.action.manager.EntityReaderManager;
import dataImport.exception.MissingAttributeException;


public abstract class AbstractInteractableEntityReader extends AbstractEntityReader implements Serializable {

	private static final long serialVersionUID = -486776227937258451L;

	protected static final String ATTRIBUTE_NAME = "name";

	protected AbstractInteractableEntityReader(final EntityReaderManager entityReaderManager) {
		super(entityReaderManager);
	}

	protected final void verifyRestrictions(final String id, final String name) {
		super.verifyRestrictions(id);

		if (name.isEmpty()) {
			throw new MissingAttributeException(ATTRIBUTE_NAME);
		}
	}
}
